﻿using A2.ERP.IDAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Remoting.Messaging;
using System.Text;
using System.Threading.Tasks;

namespace A2.ERP.DALFactory
{
    public class DBSessionFactory
    {
        //实例化dbsession,保证线程唯一

        public static IDBSession CreateDbSession()
        {
            IDBSession dbSession = (IDBSession)CallContext.GetData("dbSession");

            if (dbSession == null)
            {
                dbSession = new DBSession();
            }

            return dbSession;

        }
    }
}
